package com.imooc.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 订单表;
 * 
 * @author yukangkang
 * @email 1304473884@qq.com
 * @date 2021-01-16 21:20:11
 */
@Data
@ToString
@TableName("orders")
public class Orders implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 订单主键;同时也是订单编号
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private String id;
		/**
		 * 用户id
		 */
		@TableField(USER_ID)
		private String userId;
		/**
		 * 收货人快照
		 */
		@TableField(RECEIVER_NAME)
		private String receiverName;
		/**
		 * 收货人手机号快照
		 */
		@TableField(RECEIVER_MOBILE)
		private String receiverMobile;
		/**
		 * 收货地址快照
		 */
		@TableField(RECEIVER_ADDRESS)
		private String receiverAddress;
		/**
		 * 订单总价格
		 */
		@TableField(TOTAL_AMOUNT)
		private Integer totalAmount;
		/**
		 * 实际支付总价格
		 */
		@TableField(REAL_PAY_AMOUNT)
		private Integer realPayAmount;
		/**
		 * 邮费;默认可以为零，代表包邮
		 */
		@TableField(POST_AMOUNT)
		private Integer postAmount;
		/**
		 * 支付方式
		 */
		@TableField(PAY_METHOD)
		private Integer payMethod;
		/**
		 * 买家留言
		 */
		@TableField(LEFT_MSG)
		private String leftMsg;
		/**
		 * 扩展字段
		 */
		@TableField(EXTAND)
		private String extand;
		/**
		 * 买家是否评价;1：已评价，0：未评价
		 */
		@TableField(IS_COMMENT)
		private Integer isComment;
		/**
		 * 逻辑删除状态;1: 删除 0:未删除
		 */
		@TableField(IS_DELETE)
		private Integer isDelete;
		/**
		 * 创建时间（成交时间）
		 */
		@TableField(CREATED_TIME)
		private Date createdTime;
		/**
		 * 更新时间
		 */
		@TableField(UPDATED_TIME)
		private Date updatedTime;




	public final static String ID =  "`id`";
	public final static String USER_ID =  "`user_id`";
	public final static String RECEIVER_NAME =  "`receiver_name`";
	public final static String RECEIVER_MOBILE =  "`receiver_mobile`";
	public final static String RECEIVER_ADDRESS =  "`receiver_address`";
	public final static String TOTAL_AMOUNT =  "`total_amount`";
	public final static String REAL_PAY_AMOUNT =  "`real_pay_amount`";
	public final static String POST_AMOUNT =  "`post_amount`";
	public final static String PAY_METHOD =  "`pay_method`";
	public final static String LEFT_MSG =  "`left_msg`";
	public final static String EXTAND =  "`extand`";
	public final static String IS_COMMENT =  "`is_comment`";
	public final static String IS_DELETE =  "`is_delete`";
	public final static String CREATED_TIME =  "`created_time`";
	public final static String UPDATED_TIME =  "`updated_time`";


	public final static String ID_COMMENT =  "订单主键;同时也是订单编号";
	public final static String USER_ID_COMMENT =  "用户id";
	public final static String RECEIVER_NAME_COMMENT =  "收货人快照";
	public final static String RECEIVER_MOBILE_COMMENT =  "收货人手机号快照";
	public final static String RECEIVER_ADDRESS_COMMENT =  "收货地址快照";
	public final static String TOTAL_AMOUNT_COMMENT =  "订单总价格";
	public final static String REAL_PAY_AMOUNT_COMMENT =  "实际支付总价格";
	public final static String POST_AMOUNT_COMMENT =  "邮费;默认可以为零，代表包邮";
	public final static String PAY_METHOD_COMMENT =  "支付方式";
	public final static String LEFT_MSG_COMMENT =  "买家留言";
	public final static String EXTAND_COMMENT =  "扩展字段";
	public final static String IS_COMMENT_COMMENT =  "买家是否评价;1：已评价，0：未评价";
	public final static String IS_DELETE_COMMENT =  "逻辑删除状态;1: 删除 0:未删除";
	public final static String CREATED_TIME_COMMENT =  "创建时间（成交时间）";
	public final static String UPDATED_TIME_COMMENT =  "更新时间";


	public static Orders of(Object obj) {
		Orders e = new Orders();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<Orders> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
